package com.own.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.own.system.entity.Provider;
import com.own.system.mapper.ProviderMapper;
import com.own.system.service.ProviderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.own.system.vo.query.ProviderQueryVo;
import org.springframework.stereotype.Service;

/**
 *  服务实现类
 * @author anonymous
 * @since 2024-08-25
 */
@Service
public class ProviderServiceImpl extends ServiceImpl<ProviderMapper, Provider> implements ProviderService {

    @Override
    public IPage<Provider> findProviderListByPage(IPage<Provider> page, ProviderQueryVo providerQueryVo) {
        //创建条件构造器
        QueryWrapper<Provider> queryWrapper = new QueryWrapper<Provider>();
        //商品名称模糊查询
        queryWrapper.like("name",providerQueryVo.getName());
        //排序
        queryWrapper.orderByAsc("id");

        return baseMapper.selectPage(page,queryWrapper);
    }
}
